<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="box">
        <router-link to="/home">主页</router-link>
        <router-link to="/dian">内容1</router-link>
        <router-view></router-view>
    </div>
    <script src="../node_modules/vue/dist/vue.js"></script>
    <script src="../node_modules/vue-router/dist/vue-router.js"></script>
    <script>
        let Home = {
            template : `
                <h1>主页{{massge}}</h1>
            `,
            data : function(){
                return {
                    massge : "完蛋"
                }
            },
        };
        let dian = {
            template : `
                <h2>内容页{{$route.meta}}</h2>
            `,
            created() {
                console.log(this.$route);
            },
        };
        let routes = [
            {
                path : "/home",
                component : Home,
            },
            {
                path : "/dian",
                component : dian,
                meta : ["数据","算法","结果"],
            },
        ];
        let router = new VueRouter({
            routes,
        });
        let vm = new Vue({
            el : "#box",
            router,
        });
    </script>
</body>
</html>